/***********************************************************************/
/*                                                                     */
/*  FILE        :init.c                                                */
/*  DATE        :Fri, Jan 17, 2014                                     */
/*  DESCRIPTION :initialize each setting for standard I/O.             */
/*  CPU GROUP   :64                                                    */
/*                                                                     */
/*  This file is generated by Renesas Project Generator (Ver.4.19).    */
/*  NOTE:THIS IS A TYPICAL EXAMPLE.                                    */
/***********************************************************************/
/*********************************************************************
*
* Device     : M16C,R8C/Tiny
*
* File Name  : init.c
*
* Abstract   : Initialize each setting for standard I/O.
*
* History    : 1.70  (2009-03-17)
*
* Copyright (C) 2009 (2010) Renesas Electronics Corporation.
* and Renesas Solutions Corporation. All rights reserved.
*
*********************************************************************/

#if defined(NC30)		/* NCxx */
	/* dummy */
#elif defined(NC77)
	#error "NC77 not supported"
#elif defined(NC79)
	#error "NC79 not supported"
#else
	#error "NC30, NC77, NC79 not defined"
#endif				/* NCxx */



#include <stdio.h>

FILE _iob[4U];

void _init( void );

void _init( void )
{
    stdin->_cnt = stdout->_cnt = stdaux->_cnt = stdprn->_cnt = 0;
    stdin->_flag = _IOREAD;
    stdout->_flag = _IOWRT;
    stdaux->_flag = _IORW;
    stdprn->_flag = _IOWRT;

    stdin->_mod = _TEXT;
    stdout->_mod = _TEXT;
    stdaux->_mod = _BIN;
    stdprn->_mod = _TEXT;

    stdin->_func_in = _sget;
    stdout->_func_in = NULL;
    stdaux->_func_in = _sget;
    stdprn->_func_in = NULL;

    stdin->_func_out = _sput;
    stdout->_func_out = _sput;
    stdaux->_func_out = _sput;
    stdprn->_func_out = _pput;

#ifdef __UART0__
    speed(_96, _B8, _PN, _S2);
#else /* UART1 : default */
    speed(_96, _B8, _PN, _S2);
#endif
}

